<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组转字符串</title>
</head>
<body>
    <script>
        //一、join() 将数组的元素组成一个字符串
        var arr = ['1','2','3','4','5'];
        var str1 = arr.join()
        var str2 = arr.join('')
        var str3 = arr.join('-')
        console.log(str1)
        console.log(str2)
        console.log(str3)
    </script>
</body>
</html>